from Function import *

size = [5,8,12,20]

for i in size:
    n = i
    A = np.zeros((n,n))
    b = np.zeros((n,1))
    for i in range(n):
        b[i,0] = 1
        for j in range(n):
            A[i,j] = 1/(i+j+1)
    X = np.zeros((n,1))
    ans = CG_Method(X, A, b)
    print("Ans:")
    print(ans)
    print("with error:",norm(np.matmul(A,ans)-b))